package cn.autumnorange.app.scheduletask.provider.rest;

import cn.autumnorange.app.common.dto.ResultDto;
import cn.autumnorange.app.common.rpc.lock.RPCIdempotentLockTarget;
import cn.autumnorange.app.user.api.CronService;
import cn.autumnorange.app.user.api.dto.CronDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class SysUserRest implements CronService {
  @Autowired private CronService cronService;

  @Value("${server.port}")
  private int port;

  @RPCIdempotentLockTarget()
  @Override
  public ResponseEntity<ResultDto<CronDto>> getRolesByUserId(long cronId) {
    return cronService.getRolesByUserId(cronId);
  }
}
